﻿<Window x:Class="Microsoft.Research.ScientificWorkflow.UIDesigner.Monitor.MonitorSettingsWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	    x:Name="Window"
	 WindowStyle="None"  ResizeMode="NoResize" WindowStartupLocation="CenterScreen" ShowInTaskbar="False" 
	    Width="300" Height="325" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d">

    <Window.Resources>
        <Style x:Key="PopupCloseButton" BasedOn="{x:Null}" TargetType="{x:Type Button}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Grid>
                            <Rectangle Fill="#FFCCCCCC" Stroke="{x:Null}" RadiusX="4.5" RadiusY="4.5" x:Name="rectangle"/>
                            <Rectangle Fill="#FF4F4F4F" Stroke="{x:Null}" RadiusX="0" RadiusY="0" Margin="8,3.5,7,3.5" RenderTransformOrigin="0.5,0.5">
                                <Rectangle.RenderTransform>
                                    <TransformGroup>
                                        <ScaleTransform ScaleX="1" ScaleY="1"/>
                                        <SkewTransform AngleX="0" AngleY="0"/>
                                        <RotateTransform Angle="-34.039"/>
                                        <TranslateTransform X="0" Y="0"/>
                                    </TransformGroup>
                                </Rectangle.RenderTransform>
                            </Rectangle>
                            <Rectangle Fill="#FF4F4F4F" Stroke="{x:Null}" RadiusX="0" RadiusY="0" RenderTransformOrigin="0.5,0.5" Margin="8,3.5,7,3.5">
                                <Rectangle.RenderTransform>
                                    <TransformGroup>
                                        <ScaleTransform ScaleX="-1" ScaleY="1"/>
                                        <SkewTransform AngleX="0" AngleY="0"/>
                                        <RotateTransform Angle="34.039"/>
                                        <TranslateTransform X="0" Y="0"/>
                                    </TransformGroup>
                                </Rectangle.RenderTransform>
                            </Rectangle>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsFocused" Value="True"/>
                            <Trigger Property="IsDefaulted" Value="True"/>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Fill" TargetName="rectangle" Value="#FFADADAD"/>
                            </Trigger>
                            <Trigger Property="IsPressed" Value="True"/>
                            <Trigger Property="IsEnabled" Value="False"/>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="TreeViewItemFocusVisual">
            <Setter Property="Control.Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Rectangle/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

    </Window.Resources>

    <Grid x:Name="LayoutRoot">
        <Border BorderBrush="#FFBDBDBD" BorderThickness="1,1,2,2" CornerRadius="4,4,4,4" HorizontalAlignment="Center" Width="300">
            <Border.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFF7F7F7" Offset="0"/>
                    <GradientStop Color="#FFF1F1F1" Offset="1"/>
                </LinearGradientBrush>
            </Border.Background>
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="28"/>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="38"/>
                </Grid.RowDefinitions>
                <Border Name="brdrHeader" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Grid.Row="0" CornerRadius="4,4,0,0">
                    <Border.Background>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#FFF7F7F7" Offset="0"/>
                            <GradientStop Color="#FFE9E9E9" Offset="1"/>
                        </LinearGradientBrush>
                    </Border.Background>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="206*" />
                            <ColumnDefinition Width="89*" />
                        </Grid.ColumnDefinitions>
                        <TextBlock Margin="10,0,94.023,0" VerticalAlignment="Center" FontSize="14" Foreground="#FF5F5F5F" Text="Monitor settings" TextWrapping="Wrap" Height="18.62" />
						    <Button HorizontalAlignment="Right" Margin="0,5.5,5,5.5" Click="CancelButtonClick" ToolTip="Close" Style="{DynamicResource PopupCloseButton}" Width="17" Content="Button" Grid.Column="1" />
					    </Grid>
                </Border>
                <StackPanel HorizontalAlignment="Stretch" Margin="10,15,10,5" Grid.Row="1">
                    <DockPanel>
                        <CheckBox IsChecked="{Binding Path=EnableMonitoring, Mode=TwoWay}" Content="Enable Monitoring" HorizontalAlignment="Stretch" Height="Auto" Checked="EnableMonitorChecked" Unchecked="EnableMonitorUnchecked" Name="MonitoringCheck"/>
                        <CheckBox Margin="26,0,0,0" IsChecked="{Binding Path=EnableLogging, Mode=TwoWay}" Content="Enable Logging" HorizontalAlignment="Stretch" Height="Auto" Checked="EnableLoggingChecked" Unchecked="EnableLoggingUnchecked" Name="LoggingCheck"/>
                    </DockPanel>
                    <Grid Width="Auto" Height="Auto" Margin="0,10,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="55"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="0.44*"/>
                            <RowDefinition Height="0.56*"/>
                        </Grid.RowDefinitions>

                        <TextBlock HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Text="Logfile Path :" TextWrapping="Wrap" Margin="0,0,0,2"/>
						    <TextBox x:Name="logFileText" ToolTip="{Binding Path=Text, RelativeSource={RelativeSource self}}" ToolTipOpening="LogFileTextToolTipOpening"
							    Text="{Binding Path=LogFilePath, Mode=TwoWay}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Row="1" MaxLines="1" Margin="0,2,0,2" IsReadOnly="True"/>
						    <Button x:Name="browseButton" Click="BrowseButtonClick" HorizontalAlignment="Right" VerticalAlignment="Center" Content="Browse" Grid.Row="1" Grid.Column="1" Margin="0,0,0,0" Width="50" IsEnabled="False"/>
                                  
					    </Grid>
                    <Grid Margin="0,10,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="0.5*"/>
                            <ColumnDefinition Width="0.5*"/>
                        </Grid.ColumnDefinitions>
                        <StackPanel>

                            <TextBlock Text="Sources" TextWrapping="Wrap" Width="Auto" Height="Auto" FontWeight="Bold"/>
							    <CheckBox x:Name="events_Workflow" Content="Workflow Events" IsChecked="{Binding Path=NotifyWorkflowEvents, Mode=TwoWay}" Margin="0,10,0,0"/>
							    <CheckBox x:Name="events_Activity" Content="Activity Events" IsChecked="{Binding Path=NotifyActivityEvents, Mode=TwoWay}" Margin="0,10,0,0"/>
							    <CheckBox x:Name="events_Trident" Content="Trident Events" IsChecked="{Binding Path=NotifyTridentEvents, Mode=TwoWay}" Margin="0,10,0,0"/>
							    <CheckBox x:Name="events_User" Content="User Events" IsChecked="{Binding Path=NotifyUserEvents, Mode=TwoWay}" Margin="0,10,0,0" IsEnabled="False"/>
						    </StackPanel>
                        <StackPanel Grid.Column="1">

                            <TextBlock Text="Level of info" TextWrapping="Wrap" Width="Auto" Height="Auto" FontWeight="Bold"/>
							    <CheckBox x:Name="level_InformationCheckBox" IsChecked="{Binding Path=LevelInformation, Mode=TwoWay}" Content="Information" Margin="0,10,0,0" IsEnabled="False"/>
							<CheckBox x:Name="level_WarningCheckBox" IsChecked="{Binding Path=LevelWarning, Mode=TwoWay}"  Content="Warning" Margin="0,10,0,0" IsEnabled="False"/>    
                            <CheckBox x:Name="level_ErrorCheckBox" IsChecked="{Binding Path=LevelError, Mode=TwoWay}" Content="Error" Margin="0,10,0,0" IsEnabled="False"/>
							    <CheckBox x:Name="level_AllCheckBox" IsChecked="{Binding Path=LevelAll, Mode=TwoWay}"  Content="All" Margin="0,10,0,0" IsEnabled="False" />
						    </StackPanel>
                    </Grid>
                </StackPanel>
                <Border HorizontalAlignment="Stretch" Width="Auto" Grid.Row="2">
                    <Border.Background>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#FFEAEAEA" Offset="0"/>
                            <GradientStop Color="#00FFFFFF" Offset="1"/>
                        </LinearGradientBrush>
                    </Border.Background>
                    <Grid Width="145" Height="21.96" HorizontalAlignment="Right" Margin="0,0,10,0">
                        <Button HorizontalAlignment="Right" Width="70" Content="Cancel" Click="CancelButtonClick"  d:LayoutOverrides="Height" IsCancel="True"/>
                        <Button IsDefault="True" HorizontalAlignment="Left" Width="70" Content="Save"  Click="SaveButtonClick" d:LayoutOverrides="Height"/>
                    </Grid>
                </Border>
            </Grid>
        </Border>
    </Grid>
</Window>